package com.codrim.cs.data.server.dao.entity;

import com.codrim.common.utils.bean.BeanUtils;
import com.codrim.cs.data.rpc.dto.result.WholeDayDataResultDTO;
import com.codrim.cs.data.server.dao.entity.unique.key.StatCsAffAllUniqueKey;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Liang.Zhuge
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class StatCsAffAllDO extends AbstractStatCsAllDO<StatCsAffAllUniqueKey> {
    private Integer affiliateId;

    @Override
    public WholeDayDataResultDTO toWholeDayDataResultDTO() {
        WholeDayDataResultDTO dto = BeanUtils.copyProperties(this, WholeDayDataResultDTO.class);
        dto.setCompanyId(affiliateId);
        return dto;
    }

    @Override
    public StatCsAffAllUniqueKey createUniqueKey() {
        return new StatCsAffAllUniqueKey(this.getSdate(), this.getAffiliateId(), this.getSymbol());
    }

}
